<%--
  Created by IntelliJ IDEA.
  User: kurong
  Date: 2021/9/29
  Time: 11:17
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
    <title>身份认证</title>
</head>
<body>
<form>

    姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名:<input type="text" name="personName" class="personName"/><br>
    身份证号:<input type="text" name="personId" class="personId"/><br>
    <input type="button" value="实名制认证" class="personBtn"/>
</form>
<div class="personDetails1"></div>
<%--<div class="personDetails2"></div>--%>
<div class="personDetails3"></div>


<script type="text/javascript" src="${pageContext.request.contextPath}/res/jquery/jquery-3.5.1.js"
        charset="utf-8"></script>

<script>
    $(".personBtn").click(function () {
        // 1.获取个人信息
        var personName = $(".personName").val();
        console.log("personName =" + personName);
        var personId = $(".personId").val();
        console.log("personId =" + personId);

        // 2.产生ajax请求
        $.ajax({
            type: "get",
            url: "${pageContext.request.contextPath}/peron/personName/" + personName + "/personId/" + personId,
            dataType: "json",
            data: "",
            success: function (re) {
                // if (result.body !== null) {
                <%--            ${".shopInner"}--%>
                console.log("服务器端响应数据: " + re);
                console.log("服务器端响应json数据: " + JSON.stringify(re));

                $(".personDetails3").text(JSON.stringify(re.result));
                // $(".personDetails1").text(re.result.description);
                $(".personDetails2").text(re.result.address);

                // }
            }
        })
    });

</script>

</body>
</html>
